#!/usr/bin/python3
# -*- coding: utf-8 -*-
# ======================================#
# @Author   : duanqizhong
# @time     : 2021-11-6 14:25
# @file     : logger
# @Software : PyCharm
# ======================================#

import logging.config
import os
import sys

from apps.config import BASE_DIR
from apps.models.common import get_yaml_dict

path_log = os.path.join(BASE_DIR, "apps/log.yaml").replace("\\", "/")

logging.config.dictConfig(get_yaml_dict(path_log))
if sys.platform.startswith("win"):
    log = logging.getLogger("console")
else:
    log = logging.getLogger("log")
